<?php
require_once 'Zend/View/Helper/Abstract.php';
class Zend_View_Helper_FormError extends Zend_View_Helper_Abstract
{
    private $_pattern = '<span class="errors-box"><span>#1</span></span>';
    
    public function formError ($messages = array(), $pattern='')
    {
        if($pattern)$this->_pattern=$pattern;
        $str = '';
        foreach ($messages as $message){
            $str.=str_replace('#1', $message, $this->_pattern);
        }
        
        return $str;
    }
}
